package com.group3.controller.studentController;

import com.group3.domain.AttendanceResult;
import com.group3.pojo.Page;
import com.group3.pojo.receive.AttendanceReceive;
import com.group3.service.StudentAttendanceService;
import com.group3.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "学生接口")
@RestController
@RequestMapping("/student/attendance")
@CrossOrigin//开放接口
public class StudentAttendanceController {
    @Resource
    private StudentAttendanceService studentAttendanceService;

    @GetMapping(value = "/getAttendance")
    @ApiOperation(value = "根据学生id查询学生个人项目考勤记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "studentId",required = true, value = "学生id",
                    dataType = "String"),
            @ApiImplicitParam(name = "startTime", value = "考勤日期时间段开始",
                    dataType = "String"),
            @ApiImplicitParam(name = "endTime", value = "考勤日期时间段结束",
                    dataType = "String"),
            @ApiImplicitParam(name = "lessonName", value = "项目名称",
                    dataType = "String"),
            @ApiImplicitParam(name = "type", value = "考勤情况",
                    dataType = "String"),
    })
    public Result<List<AttendanceResult>> getAttendance(AttendanceReceive attendanceReceive){

        Result result = studentAttendanceService.getAttendance(attendanceReceive);

        return result;
    }
}
